﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace hse_2013_e_booking
{
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }
        int currentPic = 1, countPic = 5;

        public void doNext()
        {
            if (currentPic == countPic)
            {
                currentPic = 1;
                pictureBox1.BackgroundImage = Image.FromFile(@"../../Resources/" + currentPic + ".jpg");
            }
            else
            {
                currentPic++;
                pictureBox1.BackgroundImage = Image.FromFile(@"../../Resources/" + currentPic + ".jpg");
            }
        }
        public void doPrev()
        {
            if (currentPic == 1)
            {
                currentPic = countPic;
                pictureBox1.BackgroundImage = Image.FromFile(@"../../Resources/" + currentPic + ".jpg");
            }
            else
            {
                currentPic--;
               pictureBox1.BackgroundImage = Image.FromFile(@"../../Resources/" + currentPic + ".jpg");
            }
        }



        private void autoTimer_Tick(object sender, EventArgs e)
        {
            
             doNext();
         
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            doNext();
        }

    }
}
